package pl.edu.agh.student.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "bik_obligations")
public class BikObligation extends AbstractEntity{
    
	private static final long serialVersionUID = 1L;
	private Application application;
	private String bank;
	private String month;
	private double money;
	private String currency;

	public BikObligation(){
		super();
	}
	
	public BikObligation(String bank, String month, Double money, String currency){
		super();
		this.bank = bank;
		this.month = month;
		this.money = money;
		this.currency = currency;
	}
	
    @ManyToOne
    @JoinColumn(name = "application_id")
    public Application getApplication() {
        return application;
    }

    public void setApplication(Application application) {
        this.application = application;
    }
	
	@Column
	public String getBank(){
		return bank;
	}
	
	public void setBank(String bank){
		this.bank = bank;
	}
	
	@Column(name = "montch") //specjalnie to nie pomylka
	public String getMonth() {
		return month;
	}
	
	public void setMonth(String month){
		this.month = month;
	}

	@Column
	public double getMoney() {
		return money;
	}
	
	public void setMoney(double money) {
		this.money = money;
	}

	@Column
	public String getCurrency() {
		return currency;
	}
	
	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public String toString() {
		return BikObligation.class.getSimpleName() + ": " + "Bank: " + bank
				+ "; Month: " + month + "; money: " + money + " " + currency;
	}
}
